##########################################################
# kmm v0.2b by Chuck Chargin Jr. (cchargin@comcast.net)
##########################################################
# History:
#
# July 10 2004: First public release of kmm.pl version 0.1
#                
# July 20 2004: version 0.2
#               Added .uts to mod extensions (thanks Darth333)
#               Changed 'system del' to unlink (thanks tk102)
#               Changed list boxes to trees
#               Added mod groups
#               Added 'deactivate all' button
#
# August 25 2004: version 0.2a
#                 Added .lip to mod extensions (thanks RedHawke)
#                 Fixed a bug that could leave a file destination empty
#
# October 18 2004:version 0.2b
#                 Added .jrl to mod extensions (thanks RedHawke)
#                 Added .rim to mod extensions (thanks Shangoman)
#
##########################################################

This script is released under the GPL, see the included
GPL.txt.

Kotor Mod Manager (KMM) is a script to manage your kotor mods.

features:
 -keeps track of all your installed mods
 -when a mod is activated it copies the files to override
 -when a mod is de-activated it removes the files from override
 -supports mods that put files in places other than override
 -checks for conflicts between mods
 -mod groups let you activate a bunch of mods with 1 click
 -completely compatible with kmm 0.1 files

Installation:
 -make a directory and put the files into it

De-installation:
 -delete the files and the directory

Preparation:
  KMM expects each mod to be in its own directory.  I recommend creating
a MOD directory where you then create directories for each mod.  A mod may 
have files in subdirectories, KMM will find them.

Example:

  c:\
   |
   +-kotor mods
         |
         +-mod1
         |
         +-mod2

Using KMM:

First use:
  -The KMM: Set preferences dialog will open
  -The kotor directory should be correct, choose another directory if needed
  -Select the directory where your mods are
  -click OK

Kotor Mod Manager main window:
  Inactive mods list:
    This shows all the currently installed mods and groups that are not active

  Active mods list:
    This shows all the currently installed mods and groups that are active

  Activate mod button:
    -Select a mod or group in the "inactive mods" list
    -Click "Activate mod"
    -KMM will copy the files in the selected mod to the kotor override
     directory, or any other directory the mod files should go

  Deactivate mod button:
    -Select a mod or group in the "active mods" list
    -Click "Deactivate mod"
    -KMM will remove the files in the selected mod from the kotor override
     directory, or any other directory the mod files are located

  Deactivate ALL button:
    -This will deactivate ALL currently active mods and groups
    -KMM will remove the files in the mods from the kotor override
     directory, or any other directory the mod files are located

  Mod description button (does not work with groups):
    -Select a mod in either the "inactive mods" or "active mods" lists
    -Click "Mod description"
    -If the mod has a readme file defined in its .kmm file notepad will
     open and display the specifed readme file

  Create group button:
    IMPORTANT: to create a group you must not have a group currently active!
    -Activate the mods that you want to be part of the group
    -click "Create group"
    -A window will pop-up asking for the group name.  Fill in the name
     then click "ok"

  Add mod button:
    -Click "Add mod"
    -A file selection dialog will open.  The starting directory is the
     mod directory you selected when you first ran KMM
    -Navigate into the directory of the mod you want to add
    -Select any 1 of the mods files
    -click open
    From here there are 2 things that can happen depending on if the
    mod has a .kmm file are not.
    
    Mod has a .kmm file:
    -The "Add mod" window will open
    -All of the information should be filled in from the .kmm file
    -If no changes are required click "Add the mod"
    -If changes are required, make them then click "Add and update kmm"
     See "Mod does not have .kmm file" section for more info on
     changing things.

    Mod does not have .kmm file:
    -The "Add mod" window will open
    -KMM will try to find a readme file for the mod and open it.
    -KMM will try to determine which files are mod files and which
     are support files. See below for more info.
    -If you just want to get on to using the mod click "Add the mod"
     otherwise read on to see how to change things.
    -If you want to change the mod name, author or mod version, just
     change the text in those boxes.
    -If you want to change the description file location you must put the
     RELATIVE path to the file.  So, if your mod is in c:\moddir\mymod and
     your readme is in c:\moddir\mymod\files\readme.txt, you would put:
     files\readme.txt.  KMM will only autodetect readme files that are in
     the root directory of the mod.  That would be c:\moddir\mymod in the
     given example.
    -You will notice that the files listed for the mod start with either
     "MOD:" or "SUP:".  Mod files get copied to override (or other locations
     as needed).  SUP or Support files never get copied.  They are just
     information or pictures that came with the mod.  If you want to change
     the type of file do the following:
      -select the file you want to change
      -click "MOD/SUP", this will toggle the file type
    -Each mod file by default has a destination of "override\".  If a mod
     file has to go into a directory other than override you can change
     it by doing the following:
      -select the file you want to change
      -click "Destination"
      -A folder browser window will open up.  Naviagte to the directoy
      where the mod file should be installed.
      -Click "OK"
    -When everything is how you want it, click "Add the mod"

  Delete mod button:
    -Select a mod or group in the "inactive mods" or "active mods" lists
    -Click "Delete mod"
    -An inactive mod will be removed from KMM
    -An active mod will first be deactivated, this removes its files
     from override (or other locations).  Then the mod will be removed
     from KMM
    -IMPORTANT: "Delete mod" does NOT delete the mod files in the mod
     directory.  It simply removes it from KMM managment.
    -IMPORTANT: Deleting a group only deletes the group, it does NOT
     delete the mods in the group.

Questions you may have:

Q: Can I add mods to an already existing group?
A: No.

Q: Can I have more than 1 group active?
A: Yes.

Q: Can I have a group in a group?
A: No.

Q: When I click "Create group" nothing happens.
A: Make sure you do not have a group in the active list.  You can not have
   a group in a group.  Deactivate all groups and try again.

Q: How can I change the mod directory location, or the location of kotor
   that KMM uses?
A: In the same directory as kmm is a file kmm.conf. Exit kmm.  Delete
   kmm.conf.  Start kmm.  You will see the "set preferences" window.
   Select your directories and click "OK".

Q: How can I clear out all mods managed by kmm without having to click
   the "delete mod" button many times?
A: 1) click "deactivate all"
   2) exit KMM
   3) Find and delete "installedmods.kmm" and "modgroups.kmm"

Q: How can I modify an existing .kmm file?
A: Do not open up a .kmm file in a text editor and change it!  If the
   mod is already installed in KMM, select it then click "Delete mod".
   Now click "Add mod" and add the mod back in.  When the add mod window
   opens you can make your changes.  When you are done click 
   "Add and update kmm".

Q: Will KMM copy ANY files?
A: No, KMM has a list of files it considers mod files.  It will not move or
   delete any files not on that list.  To see the list open up kmm.pl and
   look for "our %modextensions".  Remember changing this list ONLY affects
   the kmm.pl script, it does NOT affect the compiled script kmm.exe.

Q: Will KMM overwrite files?
A: KMM will overwrite files in only 1 case.  If a mod was not properly
   deactivated and it left files in override.  When you activate the mod
   that owns that file KMM will recognize it as the same file and overwrite it.

Q: How does KMM know that 2 files are the same?
A: KMM checks 3 things:
   -the file name
   -the file size
   -the files last modified time
   If 2 files have all of these the same KMM considers the files to be
   identical.

Q: What are those files that KMM created after I ran it?
A: installedmods.kmm = all the mods managed by KMM and if they are active
   kmm.conf = holds the location of kotor directory and your mod directory
   modgroups.kmm = holds the definitions for all your groups

Q: Can I create a .kmm file and distribute it with my mod?
A: Sure!

--<< hosting and copying info >>--
You are free to host this script from your website as long
as the distribution contains only the files listed below.

You are free to submit this script to any public download
site as long as the distribution contains only the files
listed below.

GPL.txt
kmm.pl
kmm.exe
readme KMM0-2a.txt

I also ask that if you do host or submit this script to a
site send me an e-mail to let me know. My e-mail address
is at the top of this file.    
